Processor instruction with repeated execution code

ABSTRACT

The present invention relates to a design of a computer system that processes instructions with a specific operation code causing the processor to execute a certain operation twice and a method for running such computer system in a time and register space saving manner. A method is provided for executing at least one computer instruction which defines at least a first source operand and an operation to be carried out on the operand, the instruction containing at least one address field of a predetermined bit length and at least one repeated execution bit related to the first operand. The method includes accessing the first source operand; accessing the repeated execution bit and deriving from that repeated execution bit a repeated execution code defining a repeated execution condition; and selectively carrying out the operation defined in the instruction once, twice or more times in dependence of the repeated execution code. This method has the advantageous effect that in case an instruction shall be performed twice or more times, no separate or additional special instruction is necessary, thereby register space and the time for processing separate or additional logical instructions is saved.

FIELD OF THE INVENTION

The present invention refers to the field of computer or microcomputerarchitecture. In particular, the present invention is related to thedesign or the definition of instruction sets for computers andmicrocomputers and to a method of conditionally executing computerinstructions, a computer system and a computer program product. Theinvention also relates to a design of a computer system that processesinstructions with a specific operation code causing the processor toexecute a certain operation once or several times, especially twice orfour times. Particularly, the present invention relates to methods foroperating a computer system in which register addresses are generatedwith more than one execution channel controlled by one centralprocessing unit.

BACKGROUND OF THE INVENTION

In computer systems it is conventional to define in each instruction tobe executed a set of register addresses which are used to access aregister file in the computer system. The register addresses usuallyinclude first and second register addresses defining registers fromwhich operands are extracted and at least one destination registeraddress defining a register into which the results of an operation areloaded. Data processing instructions generally use the contents of thefirst and second registers in some defined mathematical or logicalmanipulation and load the results of that manipulation into the defineddestination register. Memory access instructions use the registeraddresses to define memory locations for loading and storing data to andfrom a data memory. In a load instruction, source registers define amemory location from which data is to be loaded into the destinationregister. In a store instruction, the source registers define a memorylocation into which data is to be stored from the destination register.

Some computer systems have more than one execution channel. In suchcomputer systems, each execution channel has a number of functionalunits which can operate independently, whereas both execution channelscan be in use simultaneously. In some cases the execution channels sharea common register file. It is useful in such architectures to provideinstructions which simultaneously instruct both execution channels toimplement a function so as to speed up operation of the processor. Insuch a scenario, a so-called long instruction may have two instructionportions each intended for a particular execution channel. Eachinstruction portion needs to define the register addresses for use inthe function to be performed by the execution channel for which it isintended. In some cases both instruction portions may wish to defineassociated or the same register addresses. In these situations a longinstruction needs to define two sets of register addresses, one for eachexecution channel.

In such known computer systems with more than one execution channel,parallelism has been specified implicitly, for example with a sequenceof instructions whose parallelism is extracted at run time in asuperscalar architecture, or explicitly with wide instructions, e.g.long instruction words (LIW) or very long instruction words (VLIW) whichare architecturally defined to execute a set of separate componentstogether. These known methods have the backlash in common that theyrequire a lot of instruction space.

It is an aim of the present invention to reduce the number of bitsrequired in an instruction for accessing a register file, in particularin the context of multiple execution channels in a computer system. Asanother object of the present invention in case of a repeated executionof an operation the number of the respective instruction shall bereduced. These and other objects will become apparent in the detaileddescription of the invention and the drawings.

SUMMARY OF THE INVENTION

According to one aspect of the present invention there is provided acomputer system including a decode unit for decoding instructionssupplied to the decode unit from a program memory, wherein eachinstruction has at least one bit sequence defining a register addressand at least one repeated execution bit; a register file having aplurality of registers each having the same predetermined bit capacityand addressable via at least two register address ports, one of theports being associated with a first execution channel of the computersystem and the other of the ports being associated with a secondexecution channel of the computer system; a first register addresssupply path for supplying the at least one bit sequence with therepeated execution bit in the instruction to the one register addressport; and at least the first execution channel executing the instructiononce, twice or more times in dependence of the logical value of therepeated execution bit.

According to another aspect of the present invention, there is provideda method of executing computer instructions words each of which defineat least a first operand and an operation to be carried out on theoperand, the instruction containing at least one address field of apredetermined bit length and at least one repeated execution bit relatedto the first operand, the method comprising: accessing the firstoperand; accessing the repeated execution bit and deriving from thatrepeated execution bit a repeated execution code defining a repeatedexecution condition; and selectively carrying out the operation definedin the instruction once, twice or more times in dependence of therepeated execution code.

The invention further provides a computer system for conditionallycarrying out an operation defined in a computer instruction, thecomputer system comprising: fetch and decoding circuitry for fetchingand decoding a sequence of instructions from a program memory; at leastone execution unit for conditionally executing the instructions andincluding means for accessing a repeated execution bit; an executioncode register for holding a set of condition codes used in determiningwhether or not the instruction is to be executed and to determinewhether the instruction is to be executed once, twice or more times.

The invention further provides a computer program product comprisingprogram code means in the form of a sequence of computer instructionseach of which define first and second operands and an operation to becarried out on the operands, each instruction further including anaddress field of a predetermined bit length and at least one repeatedexecution bit, the computer program product being loadable into acomputer system and cooperating with the computer system to cause therepeated execution bit to be accessed, a repeated execution conditionheld in the repeated execution bit to be checked, and the operationdefined in the instruction to be selectively carried out in dependenceof the repeated execution condition.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram illustrating a known register accesssystem;

FIG. 2 is a schematic block diagram illustrating a processor capable ofperforming the present invention; and,

FIG. 3 is a diagram illustrating the encoding of two “packed”instructions.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Before describing a particular implementation of the present inventionfirst the principle function of a register access system will bediscussed with reference to FIG. 1. FIG. 1 illustrates an instructionINST which has a number of fields including three register addressingfields which are labelled SRC1, SRC2 and DEST to denote the fact thatthey are intended to address first and second source registers and adestination register, respectively. In the described embodiment eachfield is a bit sequence having a length of six bits. FIG. 1 illustratesschematically the situation where each register address is supplied torespective address ports P1 to P3 respectively of a register bank RB toaddress the required registers. Each address port P1 to P3 of theregister bank RB receives a six bit address, and each address field hasa length of six bits. In FIG. 1, a first register REG1 will be addressedby the first source register address SRC1, and second register REG2 willbe addressed by the second source register address SRC2 and a thirdregister REG3 will be addressed by the destination address DEST.

The computer system described herein is a repeated instruction stream,multiple data (DIMD) stream machine which normally executes twoinstructions every cycle. FIG. 2 is a schematic diagram of a systemcapable of performing the present invention. In FIG. 2, referencenumeral 2 denotes a program memory which holds programs in the form of aplurality of instructions. In the normal mode of operation, each 64 bitinstruction in the program memory allows two 31 bit operations to bedefined in the manner illustrated in FIG. 3. That is, each 64 bitinstruction contains two 31 bit instruction portions labelled INST1 andINST2. Each instruction portion has associated with it a single bitwhich identifies the type of instruction. These are denoted ID1 and ID2in FIG. 5, standing for identification bits. An instruction portion canidentify a data processing (DP) operation or a load/store (LD/ST)operation as will be explained more fully hereinafter. In one variant,the allowed combinations are two data processing operations (ID1, ID2both set to “0”), two load/store operations (ID1, 1D2 both set to “1”)or one data processing and one load store operation (ID1=0, ID2=1).

The program memory 2 is connected to an instruction cache 3 which isconnected to instruction fetch/decode circuitry 4. The fetch/decodecircuitry issues addresses to the program memory and receives 64 bitlines from the program memory 2 (or cache 3), evaluates the operationcode (opcode) and transmits the respective instructions INST1, INST2along X and Y channels 5 _(x), 5 _(y). Each channel comprises a SIMDexecution unit 8 _(x), 8 _(y) which includes three data processingunits, MAC, INT and FPU and a load/store unit LSU 6. Each dataprocessing unit MAC, INT and FPU and the load/store units LSU operate ona single instruction multiple data (SIMD) principle according to theSIMD lane expressed in the instruction according to the followingprotocol which defines the degree of packing of objects for packed dataprocessing operations:

-   (B)—8 bit objects (b₀ . . . b₇)-   (H)—16 bit objects (h₀ . . . h₃)-   (W)—32 bit objects (w₀ . . . w₁)-   (L)—64 bit objects (I)-   (S)—32 bit floating point-   (D)—64 bit floating point

For each channel 5 _(x), 5 _(y) if the instruction is a data processinginstruction it is supplied to the appropriate data processing unit MAC,INT or FPU and if it is a load/store instruction it is supplied to theload/store unit LSU. Data values are loaded to and from the MAC dataprocessing units into and out of a common register file 10 whichincludes sixteen 64 bit special purpose registers along register accesspaths 12 _(x), 12 _(y). Data values are loaded to and from the INT andFPU data processing units and the load/store units LSU into and out of asecond register file 11 which includes sixty-four 64-bit general purposeregisters. Register access paths 14 _(x), 14 _(y) are provided for theseaccesses. The program counter PC which indicates the current instructioncan be read via one of the general purpose registers. Another one of thegeneral purpose registers constitutes a control and status register.

Each register access path 17 _(x), 17 _(y) carries three addresses fromthe accessing unit, two source addresses SRC1, SRC2 and a destinationaddress DST. In the case of data processing instructions, the sourceaddresses SRC1, SRC2 define registers in the register files 10, 11 whichhold source operands for processing by the data processing unit. Thedestination address DST identifies a destination register into which aresult of data processing will be placed. The operands and results areconveyed between the register file 10 or 11 and the respective dataprocessing unit via the access paths 17 _(x), 17 _(y). In the case ofload/store instructions, the instruction formats allow memory accessaddresses A_(x), A_(y) to be formulated from data values held in theregisters as described later. The load store units access a commonaddress space in the form of a data memory 16 via a dual ported datacache DCACHE 15. For this purpose, each load/store unit has a 64 bitdata bus D_(x), D_(y) and a 64 bit address bus A_(x), A_(y). Eachload/store unit 6 _(x), 6 _(y) can execute a number of different memoryaccess (load/store) instructions, implemented in formats 6 and 7 in FIG.6.

According to a first class of memory access instructions, an object isloaded into a destination register specified in the instruction (in theDST field) from an address read from a source register in theinstruction (in the BASE REG field). The length of the object depends onthe SIMD lane B, H, W or L specified in the instruction operation code.If the object length is less than 64 bits, the upper bits of thedestination register are filled with zeros. This class of instructionalso allows the number of objects to be specified. The memory address isread from the source register in the register file 11 by the specifiedload/store unit 6 _(x), 6 _(y) and despatched to the cache 15 via theappropriate address bus A_(x), A_(y). The object or objects are returnedalong the data bus D_(x) or D_(y) and loaded into the destinationregister of the register file 10 by the load/store unit. As is wellknown, on a cache miss, an access to the data memory 16 may be needed.

For each of the load instructions in the first class, there are matchingstore instructions. In each case, a single address is sent by eachload/store unit and a single data value is returned at that address.That data value can constitute a number of objects depending on thenumber specified in the instruction and the length specified in the SIMDlane of the instruction. One such load instruction allows two long wordsto be loaded from two adjacent addresses in the data memory 16 from abase address in a first source register with an offset given in a secondsource register. Each register address field can address the sameregister or paired registers as defined above. If the same registeraddress is generated, it will be used to address that register fromdifferent sides of the machine in accordance with the operationalrequirement of the instruction INST1 or INST2 being effected on thatside of the machine.

The architecture of the above described computer system supports twotypes of instruction, so called “long instructions” and “dual operationinstructions”. Each 64 bit paired operation instruction defines two 31bit operations in the manner illustrated in FIG. 3. That is, each 64 bitsequence contains two 32 bit instruction portions labelled INST1 andINST2. Each instruction also includes a designated set of identificationbits which identify the type of each operation. There are two such bitsin FIG. 3 at bit locations 31 and 63 denoted ID1 and ID2 in FIG. 3. Inthis embodiment operations are divided into data processing (DP) typesor a load/store (LD/ST) types. The allowed combinations are two dataprocessing operations (ID1,1D2 both set to “0”), two load/storeoperations (ID1,1D2 both set to “1”) or one data processing and oneload/store operation (ID1=0,ID2=1).

It is now understood that the above described computer device is capableof running instructions on two identical pipelines in form of parallelinstructions with the register fields modified, i.e. using specialinstructions which enable the device to co-execute instructions. Suchparallel instruction is represented at assembly language level by themnemonic with a 2 added, e.g. if LDL is load long, then LDL2 is loadlong dualled and loads two longs using two load store pipelines wherethe register addressing is modified on the second pipeline. This priormethod, which this invention extends upon, designated a few specialinstructions (LDL2, STL2) which caused instructions co-executing withthem to become dual executed instructions. Thereby, the possibility isprovided for the programmer to explicitly specify the parallel operationwithout using more register space. However, this known method leads toproblems in terms of what instructions were actually permitted to bealongside LDL2/STL2 and a restriction in what programmers could express.For instance, the programmer could not define ADD2: MUL2, i.e. the dualsof ADD and MUL paired with each other in one LIW instruction, since oneneeded an LDL2/STL2 to signal dualling.

Known methods for running the above described computer device do notprovide the possibility of repeated execution of one or more operationsby using the same instruction according to the present invention bymeans of repeated execution bits defined throughout the instruction set,wherein only a single repeated execution bit repeats the execution ofthe associated instruction. Computer devices can be run with extendedlength operations which function which are special instructions, e.g.the lengths go Byte, Half, Word, Long, Double Long. In contrast to this,the repeated execution bit according to the present invention providesfor the effect on all operations.

Computer architectures have restrictions due to the LIW format. In theprevious method for running computer processors separate instructionsare used that cause the processor to perform the respective operationtwice. According to one variant of the present invention, in case therepeated execution bit is set to a logical 1, the instruction containedin the respective instruction word is carried out by the processortwice. In case the repeated execution bit is set to a logical 0, theinstruction contained in the respective instruction word is carried outby the processor only once. This has the advantageous effect that incase an instruction shall be performed twice, no separate or additionalspecial instruction is necessary, thereby register space and the timefor processing separate or additional special instructions is saved. Therepeated execution bit does not elongate the instruction word. If, forinstance, the instruction word has a length of 6 bits, the address fieldcomprises 5 bits and the repeated execution bit is the 6^(th) bit of theinstruction. In case the instruction shall be executed twice, the bottombit of the instruction which is the repeated execution bit is set to alogical 1 which causes the processor to execute the instruction twice.

According to the present invention, there is a specific place in theinstruction word defined as repeated execution bit. Usually theprocessor is capable to handle long instruction words (LIW) with both 64bit and 28 bit formats. Such long instruction words contain twoinstructions or operations X and Y. According to another aspect of thepresent invention the repeated execution bits for each operation X and Yare preferably the bits in the middle of the respective instructionword. In the long instruction word preferably the bits number 32 and 33are reserved for the repeated execution bits, i.e. the bit number 32 isreserved for the repeated execution bit referring to the firstinstruction X the bit number 33 is reserved for the repeated executionbit referring to the second instruction Y. Thus, the repeated me bit ispresent in each instruction and results in more operations being decodedand passed to the computer system for execution.

In scalar 32 bit, LIW 64 bit and VLIW 128 bit instructions, theoperation itself is usually encoded in a 30 bit field. The remainingbits in the LIW 64 bit and VLIW 128 bit instructions contain therepeated execution bit, i.e. in the LIW 64 bit format the bits number 32and 33 contain the repeated execution bit. Thus, the 64 bit LIW formatis:

-   -   <OpX: 30> <d1> <d0><OpY: 30> <11>        wherein OPX and OPY designates operations to be executed and d0        and d1 designates the associated repeated execution bit causing        the respective operation to be executed once, twice or more        times in dependence of the logical value of the respective        repeated execution bit. In accordance with the present invention        it is thereby possible to express 4, 3 and 2 combinations in the        64 bit format and between 8 and 4 in the 28 format. If the bit        number 32 is set to a logical 0 and the bit number 33 is set to        a logical 0 the first instruction X is carried out once and the        second instruction Y is carried out once, so that two operations        are carried out. If, for instance, the bit number 32 is set to a        logical 1 and the bit number 33 is set to a logical 0 the first        instruction X is carried out twice and the second instruction Y        is carried out once, so that three operations are carried out.        If the bit number 32 is set to a logical 1 and the bit number 33        is set to a logical 1, too, both the first and second        instruction X and Y are carried out twice, so that all together        four operations are carried out.

In one variant of the present invention, two repeated execution bits(bits 0 and 1) are used in an instruction set to signal the mainoperation code size encoding the lengths 16 bits, 32 bits, 64 bits or128 bits. For the other formats, the main operation code size is either48, 64 or 128 bits, encoded by bits number 32 and 33.

As mentioned above, there are also processors capable of handling verylong instruction words (VLIW) with 128 bits, which can contain fourdifferent instructions or operations OP0, OP1, OP2, and OP3. In a verylong instruction each operation OP0, OP1, OP2, and OP3 has an associatedrepeated execution bit. Depending on the setting of the repeatedexecution bits the operations OP0, OP1, OP2, and OP3 contained in thevery long instruction word can be carried out once, twice or more times,respectively. In the 128 bit very long instruction word format the bitsnumber 64 and 65, 96 and 97 contain the repeated execution bits.

Thus, the 128 bit VLIW format is:

-   -   <Op3: 30> <d3> <d2> <Op2: 30> <d1> <d0> <Op1: 30> <10><Op0: 30>        <01>        wherein OP0, OP1, OP2 and OP3 designate operations to be        executed and d0, d1, d2, and d3 designate the associated        repeated execution bit causing the associated operation to be        executed once, twice or more times in dependence of the logical        value of the respective repeated execution bit. Depending on the        setting of the repeated execution bit the operations X and Y        contained in the respective instruction word can be carried out        once, twice or more times. Accordingly, the new Instruction        specification of the present invention allows to specify up to 8        operations in the 128 bit format, i.e. from 4 operations in case        each operation OP0, OP1, OP2 and OP3 is carried out only once up        to 8 operations in case each operation OP0, OP1, OP2 and OP3 is        carried out twice.

The present invention is applicable in variable length instructionschemes and provides the advantages of a consistent specification forexecuting a certain operation once, twice or more times throughout oneinstruction set regardless of the instruction format. Furthermore, thepresent invention provides a basis to save register space andenhancement of the processor performance. In still another aspect of thepresent invention, the management of the registers can be performed moreefficiently in a time saving manner, since it is possible to have allnecessary information of an instruction set available simultaneouslyavoiding the process of adding one bit to a register field, therebysaving the time it would take for a logical operation. The registeraddressing can be performed taking the bits of the register fielddirectly to the first operation in a first register field, and in asecond operation the top five bits of the register field are taken andforwarded to a second register field while the bottom bit is replaced orset to a logical one representing the repeated execution bit.

In another variant, bit number 31 of the operation is the repeatedexecution bit. This implementation applies to a computer system whichdynamically determines one or two operations per instruction, whereinbit number 31 of the single operation per instruction format would allowthe repeatedly execution of the respective operation, or bits 31 and 63of the two operations per instruction format would independently alloweach operation to be repeatedly executed.

1. A computer system comprising: a decode unit for decoding instructionssupplied to the decode unit from a program memory, wherein eachinstruction has at least one bit sequence defining a register addressand at least one repeated execution bit; a register file having aplurality of registers each having the same predetermined bit capacityand addressable via at least two register address ports, one of theports being associated with a first execution channel of the computersystem and the other of the ports being associated with a secondexecution channel of the computer system; a first register addresssupply path for supplying the at least one bit sequence with therepeated execution bit in the instruction to the one register addressport; and at least the first execution channel executing the instructiononce, twice or more times in dependence of the logical value of therepeated execution bit.
 2. A computer system according to claim 1,further comprising a second register address supply path for supplyingthe bit sequence with the repeated execution bit in the instruction tothe other register address port; and the second execution channelexecuting the instruction once, twice or more times in dependence of thelogical value of the repeated execution bit.
 3. A computer systemaccording to claim 1, wherein the first register address supply pathsupplying the at least one bit sequence with a first repeated executionbit in the first instruction to the one register address port; and asecond register address supply path for supplying the bit sequence witha second repeated execution bit in the second instruction to the otherregister address port; the first execution channel executing the firstinstruction once, twice or more tomes in dependence of the logical valueof the first repeated execution bit; and the second execution channelexecuting the second instruction once, twice or more times in dependenceof the logical value of the second repeated execution bit.
 4. A computersystem according to claim 1, wherein the execution channel executing theinstruction once, if the repeated execution bit has a logical zerovalue; and the execution channel executing the instruction twice if therepeated execution bit has a logical one value.
 5. A method of executingat least one computer instruction word which defines at least a firstoperand and an operation to be carried out on the operand, theinstruction word containing at least one address field of apredetermined bit length and at least one repeated execution bit relatedto the first operand, the method comprising: accessing the firstoperand; accessing the repeated execution bit and deriving from thatrepeated execution bit a repeated execution code defining a repeatedexecution condition; and selectively carrying out the operation definedin the instruction once, twice or more times in dependence of therepeated execution code.
 6. A method according to claim 5, wherein twoparallel computer instructions words are executed each of which definesfirst and second operands and operations to be carried out on theoperands each instruction containing a repeated execution bit related tothe first or second operands, the method comprising: accessing the firstand second operands; accessing the repeated execution bit and derivingfrom that repeated execution bit a repeated execution code defining arepeated execution condition; and selectively carrying out the operationdefined in the instruction once, twice or more times in dependence ofthe repeated execution code.
 7. A method according to claim 5, whereinthe repeated execution bit is identified in the address field of theinstruction word or the repeated execution bit is the bottom bit of theinstruction word.
 8. A method according to claim 5, wherein the repeatedexecution bits for each operation are the bits in the middle of therespective instruction word.
 9. A method according to claim 5, whereinin case of a single operation per instruction format the repeatedexecution bit is the bit number 31 of the operation which determines thenumber of executions of the respective operation, and in case of a twooperations per instruction format the repeated execution bit are thebits number 31 and 63 of the operation which independently determine thenumber of executions of the respective operation.
 10. A method accordingto claim 5, wherein the instruction word is a 64 bit format instructionword (LIW) and the bits numbers 32 and 33 are reserved for the repeatedexecution bits.
 11. A method according to claim 10, wherein the bitnumber 32 is reserved for the repeated execution bit referring to thefirst operation, and the bit number 33 is reserved for the repeatedexecution bit referring to the second operation.
 12. A method accordingto claim 5, wherein the instruction word is a 128 bit format instructionword (VLIW) and the bits numbers 64 and 65, 96 and 97 contain repeatedexecution bits.
 13. A method according to claim 5, wherein the bits ofthe register field are directly taken to the first operation in a firstregister field, and in a second operation the top five bits of theregister field are taken and forwarded to a second register field whilethe bottom bit of the register field is replaced or set to a logical onerepresenting the repeated execution bit.
 14. A computer system forconditionally carrying out an operation defined in a computerinstruction, the computer system comprising: fetch and decodingcircuitry for fetching and decoding a sequence of instructions from aprogram memory; at least one execution unit for conditionally executingthe instructions and including means for accessing a repeated executionbit; an execution code register for holding a set of condition codesused in determining whether or not the instruction is to be executed andto determine whether the instruction is to be executed once, twice ormore times.
 15. A computer program product comprising program code meansin the form of a sequence of computer instructions each of which definefirst and second operands and an operation to be carried out on theoperands, each instruction further including an address field of apredetermined bit length and at least one repeated execution bit, thecomputer program product being loadable into a computer system andcooperating with the computer system to cause the repeated execution bitto be accessed, a repeated execution condition held in the repeatedexecution bit to be checked, and the operation defined in theinstruction to be selectively carried out in dependence of the repeatedexecution condition.